package com.ice.work.moment.user.service.user;

import com.honeybee.cloud.framework.common.page.Page;
import com.ice.work.moment.facade.user.dto.UserDTO;
import com.ice.work.moment.facade.user.mapper.UserConvertMapper;
import com.ice.work.moment.facade.user.model.User;
import com.ice.work.moment.facade.user.request.PageUserRequest;
import com.ice.work.moment.user.dao.user.IUserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description ResourceServiceImpl
 * @Author DELL
 * @Create 2019-01-10
 * @Since 1.0.0
 */
@Service
public class UserServiceImpl implements IUserService {

    @Autowired
    private IUserRepository userRepository;

    @Override
    public Page<UserDTO> page(PageUserRequest request) {
        com.baomidou.mybatisplus.extension.plugins.pagination.Page<User> userPage=userRepository.page(request);
        return UserConvertMapper.INSTANCE.toDTO(userPage);
    }
}
